package com.ruoyi.qsng.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.uuid.SnowFlakeUtil;
import com.ruoyi.qsng.domain.KMyReward;
import com.ruoyi.qsng.mapper.KMyRewardMapper;
import com.ruoyi.qsng.service.IKMyRewardService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 我的签到奖励Service业务层处理
 *
 * @author kanglou
 * @date 2023-06-07
 */
@Service
public class KMyRewardServiceImpl implements IKMyRewardService {
    @Autowired
    private KMyRewardMapper kMyRewardMapper;

    /**
     * 查询我的签到奖励
     *
     * @param id 我的签到奖励主键
     * @return 我的签到奖励
     */
    @Override
    public KMyReward selectKMyRewardById(String id) {
        return kMyRewardMapper.selectKMyRewardById(id);
    }

    /**
     * 查询我的签到奖励列表
     *
     * @param kMyReward 我的签到奖励
     * @return 我的签到奖励
     */
    @Override
    public List<KMyReward> selectKMyRewardList(KMyReward kMyReward) {
        return kMyRewardMapper.selectKMyRewardList(kMyReward);
    }

    /**
     * 查询我的签到奖励列表
     *
     * @param kMyReward 我的签到奖励
     * @return 我的签到奖励集合
     */
    @Override
    public List<KMyReward> selectKMyRewardDataList(KMyReward kMyReward) {
        return kMyRewardMapper.selectKMyRewardDataList(kMyReward);
    }

    /**
     * 查询我的签到奖励列表
     *
     * @param kMyReward 我的签到奖励
     * @return 我的签到奖励
     */
    @Override
    public List<KMyReward> selectKMyRewardListForApp(KMyReward kMyReward) {
        return kMyRewardMapper.selectKMyRewardListForApp(kMyReward);
    }

    @Override
    public List<KMyReward> selectKMyRewardListForMonth(KMyReward kMyReward) {
        return kMyRewardMapper.selectKMyRewardListForMonth(kMyReward);
    }

    /**
     * 新增我的签到奖励
     *
     * @param kMyReward 我的签到奖励
     * @return 结果
     */
    @Override
    public int insertKMyReward(KMyReward kMyReward) {
        kMyReward.setId(SnowFlakeUtil.getNextId());
        kMyReward.setCreateTime(DateUtils.getNowDate());
        return kMyRewardMapper.insertKMyReward(kMyReward);
    }

    /**
     * 修改我的签到奖励
     *
     * @param kMyReward 我的签到奖励
     * @return 结果
     */
    @Override
    public int updateKMyReward(KMyReward kMyReward) {
        kMyReward.setUpdateTime(DateUtils.getNowDate());
        return kMyRewardMapper.updateKMyReward(kMyReward);
    }

    /**
     * 批量删除我的签到奖励
     *
     * @param ids 需要删除的我的签到奖励主键
     * @return 结果
     */
    @Override
    public int deleteKMyRewardByIds(String[] ids) {
        return kMyRewardMapper.deleteKMyRewardByIds(ids);
    }

    /**
     * 删除我的签到奖励信息
     *
     * @param id 我的签到奖励主键
     * @return 结果
     */
    @Override
    public int deleteKMyRewardById(String id) {
        return kMyRewardMapper.deleteKMyRewardById(id);
    }
}
